<template>
  <div id="app">
    <!-- <nav>
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link>
    </nav> -->
    <!-- <keep-alive></keep-alive> -->
    <router-view></router-view>
    <loading v-if="loadingFlag"></loading>
  </div>
</template>
<script>
import { computed } from "vue";
import { getToken } from "@/utils/getToken";
import '@/api/photo_mainCtrl'
import { Dialog } from "vant";
export default {
  data() {
    return {};
  },
  created() {
    if (window.location.href.indexOf("token") == -1) {
      console.log('没有token！');
    }
    var token = getToken().replace(/%22/g, "");
    console.log('token',token);
    if (token == 'noauth') {
      Dialog.alert({
        message: "当前账号没有权限!",
        confirmButtonText: "确定",
      }).then(() => {
        var data = {
          //sessionTimeOut : sessionTimeOutFlag //"Yes" Session超时 "No":系统正常的返回
          sessionTimeOut: 'Yes', //"Yes" Session超时 "No":系统正常的返回
          exitSysPage: "1" //"1" 信易通首页  "2":“我”页面
        };
        setTimeout(function () {
          cordova.sino.entryLocalSys(function () { }, data);
        }, 350);
      });
    }
    sessionStorage.setItem("Authorization", token);
  },
  computed: {
    loadingFlag() {
      return this.$store.state.loading.loading;
    },
  },
};
</script>
<style lang="less">
@import "./assets/style/common";
@import "./assets/style/vant-ui";

#app {
  width: auto;
  max-width: 750px;
  height: 100vh;
  margin: 0 auto;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  background-color: #f6f6f6;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
